<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>修改</title>
</head>
<body>
<form action="/emp/update" method="post">
    <input type="hidden" name="id" th:value="${emp.id}">
    <p>
        <label for="name">姓名</label>
        <input type="text" name="name" id="name" th:value="${emp.name}">
    </p>
    <p>
        性别
        <label>男<input type="radio" name="sex" value="男" th:checked="${emp.sex=='男'}"></label>
        <label>女<input type="radio" name="sex" value="女" th:checked="${emp.sex=='女'}"></label>
    </p>
    <p>
        <label for="age">年龄</label>
        <input type="number" name="age" id="age" th:value="${emp.age}">
    </p>
    <p>
        <label for="did">部门</label>
        <select name="did" id="did">
            <option th:each="d:${ds}" th:value="${d.id}" th:text="${d.name}" th:selected="${emp.did==d.id}"></option>
        </select>
    </p>
    <button>添加</button>
</form>
</body>
</html>